Skip to content

release: develop → master 2026-06-06 (#503 + #506 + #507)#508

Merged
rsalcara merged 5 commits into
masterfrom
release/develop-to-master-2026-06-06
Jun 6, 2026
Merged

release: develop → master 2026-06-06 (#503 + #506 + #507)#508
rsalcara merged 5 commits into
masterfrom
release/develop-to-master-2026-06-06

Conversation

@rsalcara

@rsalcara rsalcara commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

Promote develop into master. Three feature PRs from this cycle:

Also brings the master-only version bumps #504 (WAProto v2.3000.1040967287) and #505 (baileys-version v2.3000.1040973525) into the release base via the standard merge-master-into-release step.

Conflicts resolved

None. git merge origin/master ran clean — the version bumps live in 2 isolated files (WAProto/WAProto.proto, src/Defaults/baileys-version.json) that none of #503/#506/#507 touched.

What this brings to master

4fdc6d93cd Merge origin/master into release/develop-to-master-2026-06-06
3f409e75b1 feat(phase9): add status.db (14th file) — #507
f335c1f26d fix(contacts): resolve LID↔PN for profile-picture contacts.update — #506
eebb6d2163 fix(newsletter): parse metadata and fetch-messages responses — #503

Test plan

  • npm run build — 3 phases pass, zero errors
  • Merge resolved cleanly (no manual conflict resolution required)
  • CI green on this PR before merging

Notes

  • This release does NOT touch any of the customizations the maintainer flagged as off-limits: Carrossel, botões, listas, polls, view-once, biz quality_control, useLegacyLock, TC token custom flow, LID↔PN batched, Phase 9 multi-DB hot paths, lidDbMigrated:false, memory leak fix (cacheMetricsInterval in libsignal:790-798), schema migrations + statement cache + busy retry.
  • Phase 9 14º banco is additive — existing sessions pick it up on next open() without migration.

🤖 Generated with Claude Code


Summary by cubic

Promotes develop to master with three changes: fixes newsletter metadata parsing and message fetch, improves contacts.update picture events with LID↔PN resolution, and adds the status.db file to the multi-DB store.

  • Bug Fixes

    • Newsletter: parse metadata into the flat shape with thread_metadata and sibling node.image/preview fallbacks; use the correct messages fetch on s.whatsapp.net and return structured message results.
    • Contacts: resolve LID↔PN for profile-picture updates and drop bogus self mappings.
  • New Features

    • Add status.db (14th SQLite file) with Status feed + channel crosspost schema; opened automatically, no migration needed.

Written for commit 3d03204. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Introduced a dedicated status data storage (new status DB and schema).
  • Improvements

    • More robust contact-picture update handling with richer identity resolution.
    • Newsletter fetching/parsing revised to match upstream protocol and return structured message data.
  • Tests

    • Added unit tests for contact-picture identity resolution and updated multi-DB auth-state smoke tests.
  • Documentation

    • Updated multi-DB comments to reflect 14 physical DB files.

rsalcara added 4 commits June 5, 2026 23:20
…Sockets#2620 port) (#503)

fix(newsletter): parse metadata and fetch-messages responses (WhiskeySockets#2620 port) (#503)
…rt PR WhiskeySockets#2605) (#506)

fix(contacts): resolve LID↔PN for profile-picture contacts.update (port PR WhiskeySockets#2605) (#506)
…post schema (#507)

feat(phase9): add status.db (14th file) — Status feed + channel-crosspost schema (#507)
Copilot AI review requested due to automatic review settings June 6, 2026 21:44
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Thanks for opening this pull request and contributing to the project!

The next step is for the maintainers to review your changes. If everything looks good, it will be approved and merged into the main branch.

In the meantime, anyone in the community is encouraged to test this pull request and provide feedback.

✅ How to confirm it works

If you’ve tested this PR, please comment below with:

Tested and working ✅

This helps us speed up the review and merge process.

📦 To test this PR locally:

# NPM
npm install @whiskeysockets/baileys@rsalcara/InfiniteAPI#release/develop-to-master-2026-06-06

# Yarn (v2+)
yarn add @whiskeysockets/baileys@rsalcara/InfiniteAPI#release/develop-to-master-2026-06-06

# PNPM
pnpm add @whiskeysockets/baileys@rsalcara/InfiniteAPI#release/develop-to-master-2026-06-06

If you encounter any issues or have feedback, feel free to comment as well.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8bbb85c3-86ad-4cfb-bd09-fcb9ab211fcb

📥 Commits

Reviewing files that changed from the base of the PR and between 4fdc6d9 and 3d03204.

📒 Files selected for processing (1)
  • src/Socket/newsletter.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Socket/newsletter.ts

📝 Walkthrough

Walkthrough

Extends contact-picture identity resolution in socket handling, updates newsletter metadata/message parsing and fetch flow, and adds a new status.db schema with multi-db wiring and tests.

Changes

Contact Picture Identity Resolution

Layer / File(s) Summary
Contact picture identity resolver
src/Utils/contact-picture-identity.ts, src/Utils/index.ts, src/__tests__/Utils/contact-picture-identity.test.ts
New utility module exports ContactPictureIdentityContext type and resolveContactPictureIdentity function that resolves LID↔phone-number mappings with self-identity guards. Test suite validates resolution paths for LID vs phone-number inputs, null/exception fallbacks, self-number handling, and hosted LID optimization.
Socket picture notification handler
src/Socket/messages-recv.ts
Refactored picture notification handler to wire getPNForLID resolver binding and use the new identity resolver for non-group contacts. For group chats, emits contacts.update and sets GROUP_CHANGE_ICON fields; for non-group contacts, resolves richer identity data via the new utility and emits updated identity plus imgUrl.

Newsletter Protocol Updates

Layer / File(s) Summary
Newsletter metadata and message parsing
src/Socket/newsletter.ts, src/Types/Newsletter.ts
Updated parseNewsletterMetadata to unwrap server envelope, validate id, map snake_case fields, and derive picture from fallback chain. Introduced parseFetchedNewsletterMessage to extract counters, timestamps, reactions, poll votes, media routing, and protobuf Message decoding. Reworked newsletterFetchMessages to send <messages> request to S_WHATSAPP_NET (replacing message_updates), translate since to before attribute, and parse returned nodes via the new message parser.

Status Database Schema Integration

Layer / File(s) Summary
Status schema SQL definition
src/Utils/multi-db-sqlite/schemas/status.ts
New STATUS_SCHEMA constant defines status.db SQLite schema with core tables (status, status_attribution, status_info, status_crossposting_v3), supporting tables (status_text, status_media_link, status_thumbnail, status_seen_receipt, status_privacy_custom_list), and generic tables (key_value_store, props). Includes indexes and unique constraints for query optimization and entity uniqueness.
Schema wiring and multi-db registration
src/Utils/multi-db-sqlite/schemas/index.ts
Registers STATUS_SCHEMA via re-export, adds 'status.db' to MULTI_DB_FILES tuple, maps 'status.db': STATUS_SCHEMA in SCHEMAS constant, and extends multi-db documentation to describe the new file and intended use/rollout behavior.
Multi-database documentation updates
src/Utils/multi-db-sqlite/store.ts, src/Utils/multi-db-sqlite/use-multi-db-sqlite-auth-state.ts
Documentation comments updated from 13-file to 14-file layout, including file-level descriptions, pragma comments for cache sizing calculations, startup-cost estimates for pre-opening WAL-backed files, and handle-duplication reference counts.
Test assertions for status database
src/__tests__/Utils/multi-db-sqlite-auth-state.test.ts
Phase 9 smoke test updated to expect 14 physical .db files (including status.db). Test case names and expected filesystem assertions updated accordingly. New validation block queries sqlite_master from status.db to verify presence of status-related tables, key_value_store, and props.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A rabbit hops through contact cards with glee,
mapping lids to numbers under a tree,
newsletters now unwrap and speak clear,
status finds a home, fourteens appear.
Hops, tests, and schemas — a small dev spree! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes a release merge integrating three specific PRs (#503, #506, #507) and version bumps, which matches the multi-file changeset spanning newsletter parsing, contact identity resolution, and status database schema.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/develop-to-master-2026-06-06

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Promotes develop into master, bringing in three feature/fix batches for newsletters, contact picture updates (LID↔PN correlation), and Phase 9 multi-DB expansion with a new status.db schema.

Changes:

  • Fix newsletter metadata parsing and implement a working newsletter message-fetch query + response parsing.
  • Improve contacts.update for profile-picture notifications by resolving and emitting both PN and LID when available.
  • Add Phase 9 status.db (14th SQLite file) and validate its core tables in the multi-db auth-state test.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Utils/multi-db-sqlite/use-multi-db-sqlite-auth-state.ts Doc update to reflect 14 DB files and document status.db.
src/Utils/multi-db-sqlite/store.ts Doc/comment updates for 14-handle setup and adjusted cache sizing math.
src/Utils/multi-db-sqlite/schemas/status.ts New STATUS_SCHEMA defining core Status/channel-crosspost tables & indexes.
src/Utils/multi-db-sqlite/schemas/index.ts Adds status.db to MULTI_DB_FILES and wires STATUS_SCHEMA into SCHEMAS.
src/Utils/index.ts Re-exports the new contact-picture identity helper.
src/Utils/contact-picture-identity.ts New helper to best-effort resolve LID↔PN identity for picture updates.
src/Types/Newsletter.ts Removes duplicated NewsletterCreateResponse interface declaration.
src/Socket/newsletter.ts Newsletter metadata parsing fix + new fetch-messages stanza and parsed return shape.
src/Socket/messages-recv.ts Refactors picture notification handling; uses identity resolution for non-group updates.
src/tests/Utils/multi-db-sqlite-auth-state.test.ts Updates expectations for 14 DB files; asserts status.db core tables exist.
src/tests/Utils/contact-picture-identity.test.ts Adds unit tests covering LID↔PN resolution behavior and edge cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Socket/newsletter.ts
Comment thread src/Socket/messages-recv.ts
Comment thread src/Socket/newsletter.ts Outdated
Comment thread src/Socket/newsletter.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 11 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/Socket/newsletter.ts
Comment thread src/Utils/contact-picture-identity.ts
Comment thread src/Socket/newsletter.ts
Comment thread src/Socket/newsletter.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/Utils/contact-picture-identity.ts (1)

28-28: 💤 Low value

Optional: Consider adding debug logging for resolution failures.

The .catch(() => null) pattern is appropriate for best-effort resolution, but adding debug-level logging when resolution fails could help diagnose mapping issues during development.

📊 Optional logging enhancement
-		const resolvedPn = await ctx.getPNForLID(from).catch(() => null)
+		const resolvedPn = await ctx.getPNForLID(from).catch(err => {
+			logger?.debug?.({ lid: from, err: err?.message }, 'LID→PN resolution failed')
+			return null
+		})

(Note: Would require adding optional logger to ContactPictureIdentityContext type.)

Also applies to: 42-42

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Utils/contact-picture-identity.ts` at line 28, Add optional debug logging
around the best-effort PN resolution in contact-picture-identity.ts so failures
are observable during development. In the logic that calls ctx.getPNForLID(from)
and ctx.getPNForLID(to), keep the null fallback but log at debug level when the
promise rejects, and wire in an optional logger on ContactPictureIdentityContext
to make that possible without changing behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/Utils/contact-picture-identity.ts`:
- Line 28: Add optional debug logging around the best-effort PN resolution in
contact-picture-identity.ts so failures are observable during development. In
the logic that calls ctx.getPNForLID(from) and ctx.getPNForLID(to), keep the
null fallback but log at debug level when the promise rejects, and wire in an
optional logger on ContactPictureIdentityContext to make that possible without
changing behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 095bca1b-1a38-4274-9b53-4c56b6218e17

📥 Commits

Reviewing files that changed from the base of the PR and between 13e7296 and 4fdc6d9.

📒 Files selected for processing (11)
  • src/Socket/messages-recv.ts
  • src/Socket/newsletter.ts
  • src/Types/Newsletter.ts
  • src/Utils/contact-picture-identity.ts
  • src/Utils/index.ts
  • src/Utils/multi-db-sqlite/schemas/index.ts
  • src/Utils/multi-db-sqlite/schemas/status.ts
  • src/Utils/multi-db-sqlite/store.ts
  • src/Utils/multi-db-sqlite/use-multi-db-sqlite-auth-state.ts
  • src/__tests__/Utils/contact-picture-identity.test.ts
  • src/__tests__/Utils/multi-db-sqlite-auth-state.test.ts
💤 Files with no reviewable changes (1)
  • src/Types/Newsletter.ts

…a picture fallback

PR #508 review caught an ambiguity in the picture-fallback chain inherited
from upstream PR WhiskeySockets#2620 (#503 port). The original chain only looked inside
`thread_metadata`:

    const pic = thread.picture ?? thread.image ?? thread.preview

but the in-code comment noted that for preview-only responses (non-followed
channel via invite) the server returns `image` / `preview` SIBLINGS of
`thread_metadata` rather than children of it. The chain was missing the
sibling case, so the picture came back undefined for that flow.

Extend the fallback to also try `node.image` and `node.preview`. Additive and
defensive — `undefined ?? undefined` short-circuits cleanly when the server
returns the followed-channel shape (which has worked since #503 merged).

Also refine the comment so the chain is unambiguous on the next read.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rsalcara added a commit that referenced this pull request Jun 6, 2026
…a picture fallback

PR #508 review caught an ambiguity in the picture-fallback chain inherited
from upstream PR WhiskeySockets#2620 (#503 port). The original chain only looked inside
`thread_metadata`:

    const pic = thread.picture ?? thread.image ?? thread.preview

but the in-code comment noted that for preview-only responses (non-followed
channel via invite) the server returns `image` / `preview` SIBLINGS of
`thread_metadata` rather than children of it. The chain was missing the
sibling case, so the picture came back undefined for that flow.

Extend the fallback to also try `node.image` and `node.preview`. Additive and
defensive — `undefined ?? undefined` short-circuits cleanly when the server
returns the followed-channel shape (which has worked since #503 merged).

Also refine the comment so the chain is unambiguous on the next read.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rsalcara rsalcara merged commit 3a15f64 into master Jun 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants